package com.zys.el.time.vojo;

import com.zys.el.time.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@ApiModel("用户展示类")
public class UserVo {
    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    private Long userId;

    /**
     * 头像url
     */
    @ApiModelProperty("头像url")
    private String image;

    /**
     * 用户名
     */
    @ApiModelProperty("用户名")
    private String name;

    public UserVo(User user) {
        this.userId = user.getId();
        this.image = user.getImage();
        this.name = user.getName();
    }
}
